package com.grantheath.erebus.model.nodes
{
	import com.grantheath.erebus.model.interfaces.IErebusPageNode;
	import flash.utils.getQualifiedClassName;
	import com.grantheath.erebus.model.interfaces.IErebusAssetLoader;
	import com.grantheath.erebus.model.interfaces.IErebusAssetNode;

	/**
	 * @author grantheath
	 */
	public class ErebusAssetNode extends Object implements IErebusAssetNode 
	{
		private var _pageNode : IErebusPageNode;
		private var _assetId : String;
		private var _assetSrc : String;
		private var _assetLoaderClass : Class;
		private var _assetLoader : IErebusAssetLoader;
		private var _asset : Object;
		
		public function ErebusAssetNode(node : IErebusPageNode)
		{
			_pageNode = node;
		}
		
		public function toString() : String
		{
			return assetId;
		}
		
		//GETTERS AND SETTERS
		public function get pageNode() : IErebusPageNode
		{
			return _pageNode;
		}
		
		public function set pageNode(pageNode : IErebusPageNode) : void
		{
			_pageNode = pageNode;
		}

		public function get assetId() : String
		{
			return _assetId;
		}
		
		public function set assetId(assetId : String) : void
		{
			_assetId = assetId;
		}
		
		public function get assetSrc() : String
		{
			return _assetSrc;
		}
		
		public function set assetSrc(assetSrc : String) : void
		{
			_assetSrc = assetSrc;
		}
		
		public function get assetType() : String
		{
			return getQualifiedClassName(_asset);
		}

		public function get asset() : Object
		{
			return _asset;
		}
		
		public function set asset(asset : Object) : void
		{
			_asset = asset;
		}
		
		public function get assetLoaderClass() : Class
		{
			return _assetLoaderClass;
		}
		
		public function set assetLoaderClass(assetLoaderClass : Class) : void
		{
			_assetLoaderClass = assetLoaderClass;
		}
		
		public function get assetLoader() : IErebusAssetLoader
		{
			return _assetLoader;
		}
		
		public function set assetLoader(assetLoader : IErebusAssetLoader) : void
		{
			_assetLoader = assetLoader;
		}
	}
}
